package com.netease.pris.activity.view;

import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.content.Context;
import android.content.DialogInterface.OnClickListener;
import android.content.Intent;
import android.content.res.Resources;
import android.database.Cursor;
import android.net.Uri;
import android.os.Handler;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.webkit.URLUtil;
import android.webkit.WebSettings;
import android.webkit.WebViewClient;
import android.widget.AbsListView.OnScrollListener;
import android.widget.AdapterView.OnItemLongClickListener;
import android.widget.FrameLayout;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.RelativeLayout.LayoutParams;
import android.widget.TextView;
import com.netease.framework.k;
import com.netease.pris.a.e;
import com.netease.pris.a.h;
import com.netease.pris.a.i;
import com.netease.pris.a.q;
import com.netease.pris.activity.ArticleGalleryActivity;
import com.netease.pris.activity.PRISActivityForward;
import com.netease.pris.activity.PRISActivitySetting;
import com.netease.pris.activity.dc;
import com.netease.pris.activity.view.WebViews.WebViewAdapter;
import com.netease.pris.activity.view.WebViews.c;
import com.netease.pris.app.PrisApp;
import com.netease.pris.atom.g;
import com.netease.pris.atom.z;
import com.netease.pris.b.a;
import com.netease.pris.c.l;
import com.netease.pris.v;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class PrisArticleView extends FrameLayout
  implements ah, bp
{
  public static final int a = 0;
  private static final int aw = 1;
  private static final int ax = 2;
  public static final int b = 1;
  public static final int c = 0;
  public static final int d = 1;
  public static final int e = 0;
  public static final int f = 1;
  private static final boolean n = false;
  private static final String o = "PrisArticleView";
  private static final int p = 119;
  private static Pattern q = Pattern.compile("<(?i)html(\\s|>)");
  private static final int[] r = com.netease.pris.a.u.l(PrisApp.a().getApplicationContext());
  private static final String s = "<script type=\"text/javascript\">window.pris = {device:\"android\", version:\"" + e.b(PrisApp.a().getApplicationContext()) + "\"," + " sdk_version: \"" + q.a() + "\"," + " lang : \"" + com.netease.pris.a.u.r(PrisApp.a().getApplicationContext()) + "\"," + " protocol: \"" + "1.0.1" + "\"," + " width: \"" + r[0] + "\"," + " height: \"" + r[1] + "\"," + " fontLevel : %d ," + " mode : \"%s\"," + " density : \"" + com.netease.pris.a.u.k(PrisApp.a().getApplicationContext()) + "\"," + " nightMode : \"%s\"}; " + "</script>";
  private static final String t = "<script type=\"text/javascript\">function refreshImg(id, imageSrc) {var img = document.getElementById(id);if (null != img) { img.src = imageSrc;}}</script>";
  private static final String u = "<meta name=\"viewport\" content=\"initial-scale=1.0,user-scalable=no,target-densityDpi=device-dpi,width=device-width\" />";
  private static final String v = "NORMAL";
  private static final String w = "NO_IMAGE";
  private static final String x = "NIGHT";
  private int A = 0;
  private int B = 0;
  private int C = 0;
  private com.netease.pris.protocol.d D;
  private Context E;
  private WebViewAdapter F;
  private WebSettings G;
  private boolean H = false;
  private boolean I = true;
  private boolean J = false;
  private RelativeLayout K;
  private LinearLayout L;
  private View M;
  private ImageView N;
  private View O;
  private LinearLayout P;
  private ProgressBar Q;
  private TextView R;
  private TextView S;
  private ListView T;
  private com.netease.pris.protocol.d U;
  private com.netease.pris.protocol.d V;
  private com.netease.pris.activity.a.m W;
  private LinkedList X;
  private LinkedList Y;
  private boolean Z = false;
  private String aA = null;
  private String aB = null;
  private String aC = null;
  private String aD = null;
  private int aE = -1;
  private int aa = 0;
  private int ab = 1;
  private com.netease.pris.atom.u ac;
  private String ad = null;
  private int ae;
  private int af;
  private com.netease.pris.atom.b ag;
  private int ah;
  private int ai;
  private int aj = 0;
  private int ak = 0;
  private boolean al = true;
  private int am = -1;
  private String an;
  private String ao;
  private s ap = null;
  private boolean aq = false;
  private String ar;
  private boolean as;
  private AdapterView.OnItemLongClickListener at = new bf(this);
  private View.OnClickListener au = new ae(this);
  private int av = -1;
  private ArrayList ay = new ArrayList();
  private String az = null;
  WebViewClient g = new bb(this);
  ag h = new ag(this);
  DialogInterface.OnClickListener i = new ay(this);
  AbsListView.OnScrollListener j = new be(this);
  com.netease.pris.b k = new ad(this);
  com.netease.b.b.e.d l = new ac(this);
  Handler m = new ab(this);
  private int y = 0;
  private int z = 120;

  public PrisArticleView(Context paramContext)
  {
    super(paramContext);
    this.E = paramContext;
    this.aa = 0;
    this.ah = 0;
    this.W = null;
    this.X = new LinkedList();
    this.Y = new LinkedList();
  }

  public PrisArticleView(Context paramContext, AttributeSet paramAttributeSet)
  {
    super(paramContext, paramAttributeSet);
    this.E = paramContext;
    this.aa = 0;
    this.W = null;
    this.X = new LinkedList();
    this.Y = new LinkedList();
  }

  private String A()
  {
    if (this.V == null);
    com.netease.pris.atom.u localu;
    for (String str = null; ; str = localu.ao())
    {
      return str;
      if (this.V.h == null)
        break;
      localu = (com.netease.pris.atom.u)this.V.h.getFirst();
      if (localu == null)
        break;
    }
  }

  private void B()
  {
    String str = A();
    if ((!TextUtils.isEmpty(str)) && (this.U != null))
    {
      com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.U.h.getFirst();
      this.A = v.a().a(str, localu.V(), "", com.netease.pris.atom.s.a);
      this.Y.add(new Integer(this.A));
    }
  }

  private void C()
  {
    if (this.D == null);
    while (true)
    {
      return;
      if (this.D.h != null)
      {
        com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.D.h.get(this.ah);
        if (localu == null)
          continue;
        a(501, localu, null, null);
        continue;
      }
    }
  }

  private void D()
  {
    if (this.D == null);
    while (true)
    {
      return;
      if (this.D.h != null)
      {
        com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.D.h.get(this.ah);
        if (localu == null)
          continue;
        a(502, localu, null, null);
        continue;
      }
    }
  }

  private void E()
  {
    if (this.D == null);
    while (true)
    {
      return;
      if (this.D.h != null)
      {
        com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.D.h.get(this.ah);
        if ((localu == null) || (localu.u()))
          continue;
        localu.c(true);
        com.netease.pris.c.m.b(this.E, com.netease.b.a.d.h().c(), localu.V());
        continue;
      }
    }
  }

  private void F()
  {
    String str1 = null;
    if ((this.U == null) || (this.U.h == null) || (this.U.h.getFirst() == null))
      return;
    com.netease.pris.atom.u localu1 = (com.netease.pris.atom.u)this.U.h.getFirst();
    String str2;
    label88: z[] arrayOfz;
    if (G())
    {
      str2 = this.E.getString(2131361955) + this.ac.aJ();
      if ((!localu1.K()) || (PRISActivitySetting.i(this.E)))
        break label324;
      arrayOfz = localu1.aA();
      if ((arrayOfz == null) || (arrayOfz.length <= 0))
        break label324;
    }
    label308: label324: for (String str3 = arrayOfz[0].g(); ; str3 = null)
    {
      String str4 = localu1.V();
      String str5 = localu1.b(g.b);
      com.netease.pris.atom.u localu2;
      label227: String str6;
      if ((this.V != null) && (this.V.h != null) && (this.V.h.getFirst() != null))
      {
        localu2 = (com.netease.pris.atom.u)this.V.h.getFirst();
        if (!URLUtil.isNetworkUrl(localu2.ac()))
        {
          str1 = "http://easyread.163.com" + localu2.ac();
          if (URLUtil.isNetworkUrl(localu2.ar()))
            break label308;
          str6 = "http://easyread.163.com" + localu2.ar();
        }
      }
      while (true)
      {
        PRISActivityForward.a(this.E, str2, str4, str1, str6, str5, str3, "正文Menu", this.ag);
        break;
        str2 = localu1.U();
        break label88;
        str1 = localu2.ac();
        break label227;
        str6 = localu2.ar();
        continue;
        str6 = null;
      }
    }
  }

  private boolean G()
  {
    if (((0x400 & this.af) != 0) || ((0x400 & this.ac.av()) != 0));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  private String H()
  {
    String str1;
    if ((this.U == null) || (this.U.h == null) || (this.U.h.getFirst() == null))
    {
      str1 = null;
      label32: return str1;
    }
    com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.U.h.getFirst();
    StringBuilder localStringBuilder = new StringBuilder();
    if (G());
    for (String str2 = this.E.getString(2131361955) + this.ac.aJ(); ; str2 = localu.U())
    {
      if (!TextUtils.isEmpty(str2))
        localStringBuilder.append(str2);
      String str3 = localu.b(g.b);
      if (!TextUtils.isEmpty(str3))
      {
        if (localStringBuilder.length() > 0)
          localStringBuilder.append(' ');
        localStringBuilder.append(str3);
      }
      if (localStringBuilder.length() <= 0)
        break;
      str1 = localStringBuilder.toString();
      break label32;
    }
  }

  private void I()
  {
    String str = H();
    if (str != null)
      a(this.E, str);
  }

  private String J()
  {
    String str;
    if ((this.U == null) || (this.U.h == null) || (this.U.h.getFirst() == null))
      str = null;
    while (true)
    {
      return str;
      com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.U.h.getFirst();
      if (G())
      {
        str = this.E.getString(2131361955) + this.ac.aJ();
        continue;
      }
      str = localu.U();
    }
  }

  private String K()
  {
    if ((this.U == null) || (this.U.h == null) || (this.U.h.getFirst() == null));
    for (String str = null; ; str = ((com.netease.pris.atom.u)this.U.h.getFirst()).b(g.b))
      return str;
  }

  private String L()
  {
    if ((this.U == null) || (this.U.h == null) || (this.U.h.getFirst() == null));
    for (String str = null; ; str = ((com.netease.pris.atom.u)this.U.h.getFirst()).V())
      return str;
  }

  private void a(int paramInt, Object paramObject, String paramString1, String paramString2)
  {
    int i1;
    switch (paramInt)
    {
    default:
      return;
    case 900:
      this.aq = false;
      if (this.ak != this.aj)
        break;
      i1 = 4;
      label128: this.A = v.a().a((com.netease.pris.atom.u)paramObject, i1, e());
      this.B = this.A;
    case 902:
    case 800:
    case 804:
    case 801:
    case 802:
    case 502:
    case 501:
    case 805:
    case 806:
    case 807:
    case 809:
    }
    while (true)
    {
      this.Y.add(new Integer(this.A));
      break;
      i1 = 3;
      break label128;
      this.A = v.a().d(paramString1, paramString2);
      continue;
      this.A = v.a().a(paramString1, paramString2);
      continue;
      this.A = v.a().b(paramString1, paramString2);
      continue;
      this.A = v.a().a((String)paramObject, paramString1, paramString2);
      continue;
      this.A = v.a().c(paramString1, paramString2);
      continue;
      this.A = v.a().e((com.netease.pris.atom.u)paramObject);
      continue;
      this.A = v.a().d((com.netease.pris.atom.u)paramObject);
      continue;
      this.A = v.a().a(paramString1, this.aC, this.ag);
      continue;
      this.A = v.a().b(paramString1, this.aC, this.ag);
      continue;
      this.A = v.a().a(paramString1, this.aC, this.ag, (String)paramObject, null);
      continue;
      this.A = v.a().a(paramString1, this.aC, this.ag, paramString2, false, false);
    }
  }

  public static void a(Context paramContext, String paramString)
  {
    Intent localIntent = new Intent("android.intent.action.SEND");
    String str = paramContext.getString(2131361920);
    localIntent.setType("text/plain");
    localIntent.putExtra("android.intent.extra.TEXT", paramString);
    paramContext.startActivity(Intent.createChooser(localIntent, str));
  }

  private void a(com.netease.pris.protocol.d paramd, boolean paramBoolean)
  {
    if ((paramd == null) || (paramd.h == null))
      return;
    if (paramBoolean)
      this.W.b(paramd.h);
    while (true)
    {
      this.W.a(this.am);
      break;
      this.W.b();
      this.W.a(paramd.h);
    }
  }

  private void a(com.netease.pris.protocol.d paramd, boolean paramBoolean1, boolean paramBoolean2)
  {
    if ((paramd == null) || (paramd.h == null) || (paramd.h.size() == 0));
    while (true)
    {
      return;
      if (paramBoolean1)
        break;
      com.netease.pris.protocol.d locald2 = this.U;
      this.U = paramd;
      if ((locald2 == null) || (locald2 == this.U))
        continue;
      locald2.k();
    }
    com.netease.pris.protocol.d locald1 = this.U;
    this.U = paramd;
    if ((locald1 != null) && (locald1 != this.U))
      locald1.k();
    String str1 = ((com.netease.pris.atom.u)paramd.h.get(0)).X();
    StringBuilder localStringBuilder = new StringBuilder();
    Matcher localMatcher = q.matcher(str1);
    if (localMatcher.find())
    {
      localStringBuilder.append(str1.substring(0, localMatcher.start()));
      str1 = str1.substring(localMatcher.start());
    }
    localStringBuilder.append("<script type=\"text/javascript\">function refreshImg(id, imageSrc) {var img = document.getElementById(id);if (null != img) { img.src = imageSrc;}}</script>");
    localStringBuilder.append("<meta name=\"viewport\" content=\"initial-scale=1.0,user-scalable=no,target-densityDpi=device-dpi,width=device-width\" />");
    int i1 = PRISActivitySetting.a(PRISActivitySetting.g(this.E));
    String str2 = s;
    Object[] arrayOfObject = new Object[3];
    arrayOfObject[0] = Integer.valueOf(j(i1));
    String str3;
    if (PRISActivitySetting.i(this.E))
    {
      str3 = "NO_IMAGE";
      label227: arrayOfObject[1] = str3;
      if (!PRISActivitySetting.j(this.E))
        break label332;
    }
    label332: for (String str4 = "NIGHT"; ; str4 = "")
    {
      arrayOfObject[2] = str4;
      localStringBuilder.append(String.format(str2, arrayOfObject));
      localStringBuilder.append(str1);
      this.F.scrollTo(0, 0);
      this.F.loadDataWithBaseURL("file:///android_asset/", localStringBuilder.toString(), "text/html", "UTF-8", null);
      this.F.requestLayout();
      this.C = (1 + this.C);
      break;
      str3 = "NORMAL";
      break label227;
    }
  }

  private void b(com.netease.pris.protocol.d paramd)
  {
    if (paramd == null);
    while (true)
    {
      return;
      if (paramd.h != null)
      {
        com.netease.pris.atom.u localu = (com.netease.pris.atom.u)paramd.h.get(0);
        if (localu == null)
          continue;
        String str = localu.b(g.d);
        if (str == null)
          continue;
        if (!URLUtil.isNetworkUrl(str))
          str = "http://easyread.163.com" + str;
        if (this.I)
          this.L.setVisibility(0);
        this.J = true;
        a(800, null, str, localu.V());
        continue;
      }
    }
  }

  private void c(boolean paramBoolean)
  {
    if (paramBoolean)
    {
      this.P.setVisibility(0);
      this.Q.setVisibility(0);
      this.S.setText(2131361949);
    }
    while (true)
    {
      return;
      this.P.setVisibility(8);
    }
  }

  private void f(int paramInt)
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("javascript:pris.updateFontLevel('");
    localStringBuilder.append(j(paramInt));
    localStringBuilder.append("')");
    this.F.loadUrl(localStringBuilder.toString());
  }

  private boolean f(String paramString)
  {
    int i1;
    if (this.V == null)
      i1 = 0;
    while (true)
    {
      return i1;
      if (this.V.h == null)
      {
        i1 = 0;
        continue;
      }
      com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.V.h.getFirst();
      if (localu == null)
      {
        i1 = 0;
        continue;
      }
      if (TextUtils.isEmpty(localu.ac()))
      {
        h.a(this.E, 2131361954);
        i1 = 0;
        continue;
      }
      a(801, localu.ac(), localu.V(), paramString);
      i1 = 1;
    }
  }

  private void g(String paramString)
  {
    this.aA = J();
    this.aB = K();
    this.aC = L();
    Context localContext = this.E;
    Object[] arrayOfObject = new Object[1];
    String str1;
    String str2;
    int i1;
    label75: String str3;
    int i2;
    label111: Cursor localCursor;
    if (this.aA == null)
    {
      str1 = "";
      arrayOfObject[0] = str1;
      str2 = localContext.getString(2131362135, arrayOfObject);
      if (str2.length() <= 119)
        break label198;
      i1 = 119;
      str3 = str2.substring(0, i1);
      if (i1 >= 119)
        break label217;
      if (paramString.length() <= 119 - i1)
        break label208;
      i2 = 119 - i1;
      this.az = paramString.substring(0, i2);
      this.az += str3;
      label148: localCursor = l.a(this.E);
      if (localCursor == null);
    }
    while (true)
    {
      try
      {
        boolean bool1 = localCursor.moveToFirst();
        if (!bool1)
        {
          return;
          str1 = this.aA;
          break;
          label198: i1 = str2.length();
          break label75;
          label208: i2 = paramString.length();
          break label111;
          label217: this.az = str3;
          break label148;
        }
        this.ay.clear();
        this.ay.add(Long.valueOf(localCursor.getLong(0)));
        boolean bool2 = localCursor.moveToNext();
        if (bool2)
          continue;
        if (localCursor == null)
          continue;
        localCursor.close();
        if (this.ag == com.netease.pris.atom.b.a)
        {
          this.aE = v.a().g(this.aC);
          continue;
        }
      }
      finally
      {
        if (localCursor == null)
          continue;
        localCursor.close();
      }
      if (!TextUtils.isEmpty(this.aB))
      {
        this.aE = v.a().h(this.aB);
        continue;
      }
      k(1);
    }
  }

  private void i()
  {
    this.F.d();
  }

  private int j(int paramInt)
  {
    int i1 = 4;
    switch (paramInt)
    {
    case 2:
    default:
    case 0:
    case 1:
    case 3:
    }
    while (true)
    {
      return i1;
      i1 = 6;
      continue;
      i1 = 5;
      continue;
      i1 = 2;
    }
  }

  private void j()
  {
    bd localbd = new bd(this);
    this.F.d();
    this.F.a(localbd);
  }

  private void k()
  {
    bc localbc = new bc(this);
    this.F.d();
    this.F.a(localbc);
  }

  private void k(int paramInt)
  {
    if (this.m != null)
      this.m.sendEmptyMessage(paramInt);
  }

  private void l()
  {
    aw localaw = new aw(this);
    this.F.d();
    this.F.a(localaw);
  }

  private void m()
  {
    if (this.F != null)
    {
      this.G = this.F.getSettings();
      this.F.setWebViewClient(this.g);
      this.F.setScrollBarStyle(33554432);
      this.F.a(new av(this));
      this.F.a(new ba(this));
      this.G.setJavaScriptEnabled(true);
      this.G.setPluginsEnabled(true);
    }
  }

  private void n()
  {
    this.N = ((ImageView)findViewById(2131558503));
    this.K = ((RelativeLayout)findViewById(2131558502));
    this.F = c.a(getContext());
    this.F.setLayoutParams(new RelativeLayout.LayoutParams(-1, -1));
    this.F.setBackgroundColor(k.a(this.E).c(2131230884));
    this.K.addView(this.F, 0);
    this.L = ((LinearLayout)findViewById(2131558506));
    this.M = findViewById(2131558505);
    this.T = ((ListView)findViewById(2131558504));
    this.O = LayoutInflater.from(this.E).inflate(2130903048, null);
    this.T.addFooterView(this.O);
    this.P = ((LinearLayout)this.O.findViewById(2131558426));
    this.Q = ((ProgressBar)this.O.findViewById(2131558427));
    this.S = ((TextView)this.O.findViewById(2131558428));
    this.T.setDivider(null);
    this.T.setDividerHeight(0);
    View localView = LayoutInflater.from(this.E).inflate(2130903072, null);
    this.R = ((TextView)localView.findViewById(2131558496));
    this.T.addHeaderView(localView, null, false);
  }

  private void o()
  {
    if (this.W == null)
    {
      this.W = new com.netease.pris.activity.a.m(this.E);
      this.W.a(this.X);
      this.W.a(this.au);
    }
    if (this.T != null)
      this.T.setAdapter(this.W);
  }

  private void p()
  {
    if (this.T != null)
    {
      this.T.setOnScrollListener(this.j);
      this.T.setOnItemLongClickListener(this.at);
    }
  }

  private int q()
  {
    if (this.ak == this.aj);
    for (int i1 = 4; ; i1 = 3)
      return i1;
  }

  private String r()
  {
    StringBuilder localStringBuilder = new StringBuilder();
    localStringBuilder.append("<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">");
    localStringBuilder.append("<meta name=\"viewport\" content=\"initial-scale=1.0,user-scalable=no,target-densityDpi=device-dpi,width=device-width\" />");
    localStringBuilder.append("<span style=\"position:absolute;left:50%;top:50%;text-align:center;font-size:20px;width:260px;height:20px;margin-top:-10px;margin-left:-130px;color:");
    int i1 = k.a(this.E).c(2131230992);
    Object[] arrayOfObject1 = new Object[1];
    arrayOfObject1[0] = Integer.valueOf(i1 & 0xFFFFFF);
    localStringBuilder.append(String.format("#%06x", arrayOfObject1));
    Object[] arrayOfObject2 = new Object[1];
    arrayOfObject2[0] = getResources().getString(2131362328);
    localStringBuilder.append(String.format("\">%s</span>", arrayOfObject2));
    return localStringBuilder.toString();
  }

  private void s()
  {
    if (this.ad == null);
    while (true)
    {
      return;
      if ((this.U != null) && (this.U.h.get(0) != null))
      {
        this.J = true;
        a(804, null, this.ad, ((com.netease.pris.atom.u)this.U.h.get(0)).V());
        this.T.addFooterView(this.O);
        c(true);
        continue;
      }
    }
  }

  private void t()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this.E);
    localBuilder.setItems(2131165204, this.i);
    localBuilder.create().show();
  }

  private void u()
  {
    if (i.a(a.o(), 20, 20))
      dc.b(this.E, 1);
  }

  private boolean v()
  {
    int i1 = 0;
    if ((this.L != null) && (this.L.getVisibility() == 0));
    while (true)
    {
      return i1;
      if (!this.aq)
        continue;
      i1 = 1;
    }
  }

  private boolean w()
  {
    if ((this.F != null) && (this.F.p()));
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  private String x()
  {
    if (this.U == null);
    label56: 
    while (true)
    {
      String str = null;
      return str;
      if (this.U.h.size() > 0);
      for (com.netease.pris.atom.u localu = (com.netease.pris.atom.u)this.U.h.getFirst(); ; localu = null)
      {
        if (localu == null)
          break label56;
        str = localu.b(g.b);
        break;
      }
    }
  }

  private void y()
  {
    String str = x();
    if (!TextUtils.isEmpty(str));
    try
    {
      Intent localIntent = new Intent("android.intent.action.VIEW", Uri.parse(str));
      this.E.startActivity(localIntent);
      return;
    }
    catch (Exception localException)
    {
      while (true)
        localException.printStackTrace();
    }
  }

  private void z()
  {
    this.F.a();
  }

  public int a()
  {
    return this.ah;
  }

  public Object a(int paramInt1, int paramInt2, Object paramObject)
  {
    Object localObject;
    if (paramInt2 == ArticleGalleryActivity.k)
      localObject = Boolean.valueOf(this.H);
    while (true)
    {
      return localObject;
      if (paramInt2 == ArticleGalleryActivity.q)
      {
        localObject = Integer.valueOf(this.y);
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.u)
      {
        localObject = Integer.valueOf(this.aa);
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.x)
      {
        localObject = x();
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.l)
      {
        localObject = A();
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.n)
      {
        localObject = H();
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.A)
      {
        localObject = Boolean.valueOf(w());
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.B)
      {
        localObject = Boolean.valueOf(v());
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.D)
      {
        localObject = Integer.valueOf(this.z);
        continue;
      }
      if (paramInt2 == ArticleGalleryActivity.E)
      {
        localObject = J();
        continue;
      }
      localObject = null;
    }
  }

  public void a(int paramInt)
  {
    this.ah = paramInt;
  }

  public void a(int paramInt1, int paramInt2)
  {
    this.ak = paramInt1;
    this.aj = paramInt2;
  }

  public void a(int paramInt, boolean paramBoolean)
  {
  }

  public void a(s params)
  {
    this.ap = params;
  }

  public void a(com.netease.pris.atom.b paramb)
  {
    this.ag = paramb;
  }

  public void a(com.netease.pris.atom.u paramu)
  {
    this.ac = paramu;
  }

  public void a(com.netease.pris.protocol.d paramd)
  {
    this.D = paramd;
  }

  public void a(boolean paramBoolean)
  {
    this.al = paramBoolean;
  }

  public boolean a(String paramString)
  {
    return false;
  }

  public com.netease.pris.protocol.d b()
  {
    return this.D;
  }

  public void b(int paramInt)
  {
    this.ae = paramInt;
  }

  public void b(s params)
  {
    this.ap = params;
  }

  public void b(boolean paramBoolean)
  {
    this.as = paramBoolean;
  }

  public boolean b(int paramInt1, int paramInt2, Object paramObject)
  {
    if (paramInt2 == ArticleGalleryActivity.i)
      C();
    for (int i1 = 1; ; i1 = 0)
    {
      return i1;
      if (paramInt2 == ArticleGalleryActivity.j)
      {
        D();
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.l)
      {
        B();
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.m)
      {
        F();
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.n)
      {
        I();
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.o)
      {
        f((String)paramObject);
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.p)
      {
        f(((Integer)paramObject).intValue());
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.r)
      {
        this.K.setVisibility(((Integer)paramObject).intValue());
        if (((Integer)paramObject).intValue() != 0)
          break;
        this.aa = 0;
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.s)
      {
        this.T.setVisibility(((Integer)paramObject).intValue());
        if (((Integer)paramObject).intValue() != 0)
          break;
        this.aa = 1;
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.t)
      {
        this.ab = 1;
        this.ad = null;
        if (this.W != null)
          this.W.b();
        b(this.U);
        this.R.setText(this.ac.U());
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.v)
      {
        v.a().a(e());
        com.netease.image.d.a().a(e());
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.x)
      {
        y();
        break;
      }
      if (paramInt2 == ArticleGalleryActivity.y)
      {
        z();
        break;
      }
      if (paramInt2 != ArticleGalleryActivity.C)
        continue;
      g((String)paramObject);
      break;
    }
  }

  public boolean b(String paramString)
  {
    return false;
  }

  protected String c()
  {
    return new StringBuilder().toString();
  }

  public void c(int paramInt)
  {
    this.af = paramInt;
  }

  public void c(int paramInt1, int paramInt2, Object paramObject)
  {
    if ((this.ap != null) && (this.ak == paramInt1))
      this.ap.a(paramInt1, paramInt2, paramObject);
  }

  public void c(String paramString)
  {
    this.an = paramString;
  }

  public void d()
  {
    this.am = v.b();
  }

  public void d(int paramInt)
  {
    this.am = paramInt;
  }

  public void d(String paramString)
  {
    this.ao = paramString;
  }

  public int e()
  {
    return this.am;
  }

  public void e(int paramInt)
  {
    boolean bool = true;
    if (this.ak == paramInt)
      return;
    this.ak = paramInt;
    if (this.ak == this.aj)
    {
      if (!this.H)
        break label155;
      c(this.aj, ArticleGalleryActivity.i, Boolean.valueOf(bool));
      label49: c(this.aj, ArticleGalleryActivity.q, Integer.valueOf(this.y));
      c(this.aj, ArticleGalleryActivity.w, Integer.valueOf(this.aa));
      if ((this.U != null) && (!this.Z))
      {
        this.Z = bool;
        E();
      }
    }
    com.netease.pris.protocol.d locald;
    if (!this.al)
    {
      locald = this.U;
      if (this.ak != this.aj)
        break label173;
    }
    while (true)
    {
      a(locald, bool, false);
      if (this.F == null)
        break;
      this.F.invalidate();
      break;
      label155: c(this.aj, ArticleGalleryActivity.j, Boolean.valueOf(false));
      break label49;
      label173: bool = false;
    }
  }

  public void e(String paramString)
  {
    this.ar = paramString;
  }

  public void f()
  {
    if (e() > 0)
    {
      v.a().a(e());
      com.netease.image.d.a().a(e());
    }
  }

  protected void g()
  {
  }

  public void g(int paramInt)
  {
    this.aa = 0;
    this.H = false;
    this.y = 0;
    this.z = 120;
    this.U = null;
    this.V = null;
    this.N.setVisibility(8);
    this.K.setVisibility(0);
    this.T.setVisibility(8);
    this.Y.clear();
    this.h.a();
    this.Z = false;
    v.a().a(this.k);
    if (this.I)
    {
      if (!this.as)
        break label182;
      this.M.setVisibility(8);
    }
    while (true)
    {
      this.L.setVisibility(0);
      if (this.F != null)
      {
        this.F.clearHistory();
        this.F.stopLoading();
        this.F.loadUrl("about:blank");
        this.C = 0;
      }
      f();
      d();
      if (this.ac != null)
        a(900, this.ac, null, null);
      return;
      label182: this.M.setVisibility(0);
    }
  }

  // ERROR //
  protected void h()
  {
    // Byte code:
    //   0: aload_0
    //   1: getfield 319	com/netease/pris/activity/view/PrisArticleView:ay	Ljava/util/ArrayList;
    //   4: astore_1
    //   5: aload_1
    //   6: monitorenter
    //   7: aload_0
    //   8: getfield 319	com/netease/pris/activity/view/PrisArticleView:ay	Ljava/util/ArrayList;
    //   11: invokevirtual 1153	java/util/ArrayList:size	()I
    //   14: ifle +457 -> 471
    //   17: aload_0
    //   18: getfield 319	com/netease/pris/activity/view/PrisArticleView:ay	Ljava/util/ArrayList;
    //   21: bipush 255
    //   23: aload_0
    //   24: getfield 319	com/netease/pris/activity/view/PrisArticleView:ay	Ljava/util/ArrayList;
    //   27: invokevirtual 1153	java/util/ArrayList:size	()I
    //   30: iadd
    //   31: invokevirtual 1156	java/util/ArrayList:remove	(I)Ljava/lang/Object;
    //   34: checkcast 759	java/lang/Long
    //   37: invokevirtual 1160	java/lang/Long:longValue	()J
    //   40: lstore_3
    //   41: aload_0
    //   42: getfield 333	com/netease/pris/activity/view/PrisArticleView:E	Landroid/content/Context;
    //   45: invokevirtual 1164	android/content/Context:getContentResolver	()Landroid/content/ContentResolver;
    //   48: getstatic 1169	com/netease/pris/provider/af:k	Landroid/net/Uri;
    //   51: lload_3
    //   52: invokestatic 1175	android/content/ContentUris:withAppendedId	(Landroid/net/Uri;J)Landroid/net/Uri;
    //   55: getstatic 1178	com/netease/pris/c/l:a	[Ljava/lang/String;
    //   58: aconst_null
    //   59: aconst_null
    //   60: aconst_null
    //   61: invokevirtual 1184	android/content/ContentResolver:query	(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;
    //   64: astore 5
    //   66: aload 5
    //   68: ifnull +13 -> 81
    //   71: aload 5
    //   73: invokeinterface 747 1 0
    //   78: ifne +23 -> 101
    //   81: aload_0
    //   82: iconst_1
    //   83: invokespecial 726	com/netease/pris/activity/view/PrisArticleView:k	(I)V
    //   86: aload 5
    //   88: ifnull +10 -> 98
    //   91: aload 5
    //   93: invokeinterface 750 1 0
    //   98: aload_1
    //   99: monitorexit
    //   100: return
    //   101: aload_0
    //   102: aload 5
    //   104: iconst_4
    //   105: invokeinterface 1187 2 0
    //   110: putfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   113: aload_0
    //   114: getfield 329	com/netease/pris/activity/view/PrisArticleView:aD	Ljava/lang/String;
    //   117: invokestatic 370	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   120: ifne +119 -> 239
    //   123: new 166	java/lang/StringBuilder
    //   126: dup
    //   127: invokespecial 169	java/lang/StringBuilder:<init>	()V
    //   130: aload_0
    //   131: getfield 321	com/netease/pris/activity/view/PrisArticleView:az	Ljava/lang/String;
    //   134: invokevirtual 175	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   137: ldc_w 1189
    //   140: invokevirtual 175	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   143: aload_0
    //   144: getfield 329	com/netease/pris/activity/view/PrisArticleView:aD	Ljava/lang/String;
    //   147: invokevirtual 175	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   150: invokevirtual 224	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   153: astore 6
    //   155: aload_0
    //   156: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   159: iconst_5
    //   160: if_icmpne +97 -> 257
    //   163: aload_0
    //   164: getfield 323	com/netease/pris/activity/view/PrisArticleView:aA	Ljava/lang/String;
    //   167: invokestatic 370	android/text/TextUtils:isEmpty	(Ljava/lang/CharSequence;)Z
    //   170: ifeq +78 -> 248
    //   173: aload_0
    //   174: getfield 333	com/netease/pris/activity/view/PrisArticleView:E	Landroid/content/Context;
    //   177: ldc_w 1190
    //   180: invokevirtual 441	android/content/Context:getString	(I)Ljava/lang/String;
    //   183: astore 13
    //   185: aload 13
    //   187: invokevirtual 737	java/lang/String:length	()I
    //   190: bipush 30
    //   192: if_icmple +12 -> 204
    //   195: aload 13
    //   197: iconst_0
    //   198: bipush 30
    //   200: invokevirtual 625	java/lang/String:substring	(II)Ljava/lang/String;
    //   203: pop
    //   204: aload_0
    //   205: getfield 325	com/netease/pris/activity/view/PrisArticleView:aB	Ljava/lang/String;
    //   208: pop
    //   209: invokestatic 1195	com/netease/b/b/a/b:a	()Lcom/netease/b/b/a/b;
    //   212: aload 5
    //   214: iconst_2
    //   215: invokeinterface 1196 2 0
    //   220: aload 6
    //   222: aconst_null
    //   223: aload_0
    //   224: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   227: invokevirtual 1199	com/netease/b/b/a/b:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   230: pop
    //   231: goto -145 -> 86
    //   234: astore_2
    //   235: aload_1
    //   236: monitorexit
    //   237: aload_2
    //   238: athrow
    //   239: aload_0
    //   240: getfield 321	com/netease/pris/activity/view/PrisArticleView:az	Ljava/lang/String;
    //   243: astore 6
    //   245: goto -90 -> 155
    //   248: aload_0
    //   249: getfield 323	com/netease/pris/activity/view/PrisArticleView:aA	Ljava/lang/String;
    //   252: astore 13
    //   254: goto -69 -> 185
    //   257: aload_0
    //   258: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   261: iconst_1
    //   262: if_icmpne +31 -> 293
    //   265: invokestatic 1204	com/netease/b/b/f/a:a	()Lcom/netease/b/b/f/a;
    //   268: aload 5
    //   270: iconst_2
    //   271: invokeinterface 1196 2 0
    //   276: aload 6
    //   278: aconst_null
    //   279: aconst_null
    //   280: aconst_null
    //   281: aconst_null
    //   282: aload_0
    //   283: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   286: invokevirtual 1207	com/netease/b/b/f/a:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   289: pop
    //   290: goto -204 -> 86
    //   293: aload_0
    //   294: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   297: iconst_3
    //   298: if_icmpne +30 -> 328
    //   301: invokestatic 1212	com/netease/b/b/g/c:a	()Lcom/netease/b/b/g/c;
    //   304: aload 5
    //   306: iconst_2
    //   307: invokeinterface 1196 2 0
    //   312: aload 6
    //   314: aconst_null
    //   315: aconst_null
    //   316: aconst_null
    //   317: aload_0
    //   318: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   321: invokevirtual 1215	com/netease/b/b/g/c:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   324: pop
    //   325: goto -239 -> 86
    //   328: aload_0
    //   329: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   332: iconst_4
    //   333: if_icmpne +28 -> 361
    //   336: invokestatic 1220	com/netease/b/b/b/a:a	()Lcom/netease/b/b/b/a;
    //   339: aload 5
    //   341: iconst_2
    //   342: invokeinterface 1196 2 0
    //   347: aload 6
    //   349: aconst_null
    //   350: aload_0
    //   351: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   354: invokevirtual 1221	com/netease/b/b/b/a:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   357: pop
    //   358: goto -272 -> 86
    //   361: aload_0
    //   362: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   365: iconst_2
    //   366: if_icmpne +30 -> 396
    //   369: invokestatic 1226	com/netease/b/b/d/c:a	()Lcom/netease/b/b/d/c;
    //   372: aload 5
    //   374: iconst_2
    //   375: invokeinterface 1196 2 0
    //   380: aload 6
    //   382: aconst_null
    //   383: aconst_null
    //   384: aconst_null
    //   385: aload_0
    //   386: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   389: invokevirtual 1227	com/netease/b/b/d/c:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   392: pop
    //   393: goto -307 -> 86
    //   396: aload_0
    //   397: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   400: bipush 6
    //   402: if_icmpne +28 -> 430
    //   405: invokestatic 1232	com/netease/b/b/c/a:a	()Lcom/netease/b/b/c/a;
    //   408: aload 5
    //   410: iconst_2
    //   411: invokeinterface 1196 2 0
    //   416: aload 6
    //   418: aconst_null
    //   419: aload_0
    //   420: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   423: invokevirtual 1233	com/netease/b/b/c/a:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   426: pop
    //   427: goto -341 -> 86
    //   430: aload_0
    //   431: getfield 304	com/netease/pris/activity/view/PrisArticleView:av	I
    //   434: bipush 7
    //   436: if_icmpne -350 -> 86
    //   439: invokestatic 1238	com/netease/b/b/h/d:a	()Lcom/netease/b/b/h/d;
    //   442: aload 5
    //   444: iconst_2
    //   445: invokeinterface 1196 2 0
    //   450: aload 6
    //   452: aconst_null
    //   453: aconst_null
    //   454: aconst_null
    //   455: aconst_null
    //   456: aconst_null
    //   457: aconst_null
    //   458: aconst_null
    //   459: aconst_null
    //   460: aload_0
    //   461: getfield 309	com/netease/pris/activity/view/PrisArticleView:l	Lcom/netease/b/b/e/d;
    //   464: invokevirtual 1241	com/netease/b/b/h/d:a	(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Lcom/netease/b/b/e/d;)I
    //   467: pop
    //   468: goto -382 -> 86
    //   471: aload_0
    //   472: iconst_2
    //   473: invokespecial 726	com/netease/pris/activity/view/PrisArticleView:k	(I)V
    //   476: goto -378 -> 98
    //
    // Exception table:
    //   from	to	target	type
    //   7	237	234	finally
    //   239	476	234	finally
  }

  public void h(int paramInt)
  {
  }

  public void i(int paramInt)
  {
    if (this.aj == paramInt)
    {
      v.a().a(this.B, 4);
      if (e() > 0)
        com.netease.image.d.a().a(e(), 4);
    }
    while (true)
    {
      return;
      v.a().a(this.B, 3);
      if (e() <= 0)
        continue;
      com.netease.image.d.a().a(e(), 2);
    }
  }

  protected void onAttachedToWindow()
  {
    super.onAttachedToWindow();
    v.a().a(this.k);
  }

  protected void onDetachedFromWindow()
  {
    v.a().b(this.k);
    if (this.h != null)
    {
      this.h.b();
      this.h = null;
    }
    if (this.k != null)
      this.k = null;
    if (this.Q != null)
      this.Q.setVisibility(8);
    if (this.P != null)
      this.P.setVisibility(8);
    if (this.F != null)
    {
      this.F.destroy();
      this.F = null;
    }
    if (this.W != null)
    {
      if ((this.W instanceof com.netease.pris.activity.a.m))
        this.W.b();
      this.W = null;
    }
    if (this.X != null)
    {
      this.X.clear();
      this.X = null;
    }
    if (this.Y != null)
      this.Y.clear();
    if (this.V != null)
    {
      this.V.k();
      this.V = null;
    }
    if (this.U != null)
    {
      this.U.k();
      this.U = null;
    }
    if (this.T != null)
      this.T = null;
    if (this.D != null)
      this.D = null;
    if (this.ac != null)
      this.ac = null;
    if (this.ad != null)
      this.ad = null;
    if (this.g != null)
      this.g = null;
    if (this.ay != null)
    {
      this.ay.clear();
      this.ay = null;
    }
    if (this.m != null)
    {
      this.m.removeMessages(1);
      this.m.removeMessages(2);
      this.m = null;
    }
    if (this.E != null)
      this.E = null;
    this.G = null;
    this.K = null;
    this.N = null;
    this.L = null;
    this.M = null;
    this.O = null;
    this.P = null;
    this.Q = null;
    this.S = null;
    this.an = null;
    this.ar = null;
    this.E = null;
    super.onDetachedFromWindow();
  }

  protected void onFinishInflate()
  {
    super.onFinishInflate();
    n();
    m();
    o();
    p();
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.pris.activity.view.PrisArticleView
 * JD-Core Version:    0.6.0
 */